#include <iostream>
using namespace std;

class MathItem
{
public:
    void output();
    const double operator()(int choice) const; // test () operator
    MathItem(int x, double y);
    int getFull();
    double getCents();

private:
    int full;
    double cents;
};


int main()
{
    MathItem example_item(2, 0.5);
    example_item.output();
    cout << "The test result is " << example_item(5) << endl;

    return 0;
}

const double MathItem::operator()(int choice) const
{
    if (choice == 0)
        return full;
    else
        return cents;
}

MathItem::MathItem(int x, double y) : full(x), cents(y)
{}

int MathItem::getFull()
{
    return full;
}

double MathItem::getCents()
{
    return cents;
}

void MathItem::output()
{
    cout << "The full part is " << getFull() << " and the cents part is " << getCents() << endl;
}